#ifndef PLAYER_H
#define PLAYER_H

#include "Renderable.h"
#include "SpriteAnimation.h"
#include "SDL.h"

class Player : public Renderable {
public:
	Player(int x, int y, SpriteAnimation* animation);
	~Player();
	void setAnimation(SpriteAnimation* animation);
	void jump();
	//Entity members
	double getXPos() { return xPos; }
	double getYPos() { return yPos; }
	void setXPos(double x);
	void setYPos(double y);
	void setName(std::string name);
	std::string getName() { return name; }
	//Renderable members
	void setTexture(SDL_Surface* texture);
	SDL_Surface* getTexture() { return animation->getTexture(); }
	void setClip(SDL_Rect clip);
	SDL_Rect getClip() { return animation->getClip(); }
	void update(Uint32 delta);
	void setDirection(Direction dir);
	Direction getDirection() { return dir; }
	void handleCollision(Direction dir);

private:
	double xPos;
	double yPos;
	double prevXPos;
	double prevYPos;
	bool isMoving;
	bool isJumping;
	double currJumpVelocity;
	double startingJumpVelocity;
	SpriteAnimation* animation;
	SDL_Rect clip;
	std::string name;
	Direction dir;
	Uint8 elapsedTime;
	double speed;
};

#endif